package Reeks5.VanRansbeeck.Kevin.Model.States.Game;

import java.util.logging.Level;
import java.util.logging.Logger;

public class FlopState implements PokerSpelState {
    
    public String getStatus() {
        return "Flopped";
    }

    public void blinds(SpelStateContext aThis) {
        try {
            throw new IllegalGameActionException("Pre-flop gaat enkel vanuit new state.");
        } catch (IllegalGameActionException ex) {
            Logger.getLogger(FlopState.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void flop(SpelStateContext aThis) {
        try {
            throw new IllegalGameActionException("We zijn al flopped.");
        } catch (IllegalGameActionException ex) {
            Logger.getLogger(FlopState.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void turn(SpelStateContext aThis) {
        // als alle spelers != newstate
        aThis.setSpelState(new TurnState());
    }

    public void river(SpelStateContext aThis) {
        try {
            throw new IllegalGameActionException("Naar river gaat enkel vanuit de turn state.");
        } catch (IllegalGameActionException ex) {
            Logger.getLogger(FlopState.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void showdown(SpelStateContext aThis) {
        // als alle spelers all-in zijn (of alle spelers -1 all-in zijn)
        aThis.setSpelState(new ShowdownState());
    }
    
    public void winner(SpelStateContext aThis) {
        try {
            throw new IllegalGameActionException("Winnaar kan alleen vanuit showdown state komen.");
        } catch (IllegalGameActionException ex) {
            Logger.getLogger(FlopState.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void reset(SpelStateContext aThis) {
        try {
            throw new IllegalGameActionException("Reset kan alleen vanuit winnaar state komen.");
        } catch (IllegalGameActionException ex) {
            Logger.getLogger(FlopState.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    
}
